package com.tonann.app.service;

import com.tonann.app.domain.AppSensor;
import com.tonann.app.domain.AppSensorDept;
import com.tonann.app.domain.AppSensorPlace;
import com.tonann.common.core.page.TableDataInfo;

import java.util.List;

/**
 * 传感器管理Service接口
 *
 * @author tonann
 * @date 2022-10-17
 */
public interface IAppSensorService {
    /**
     * 查询传感器管理
     *
     * @param sensorId 传感器管理主键
     * @return 传感器管理
     */
    public AppSensor selectAppSensorBySensorId(Long sensorId);

    /**
     * 查询传感器管理列表
     *
     * @param appSensor 传感器管理
     * @return 传感器管理集合
     */
    public List<AppSensor> selectAppSensorList(AppSensor appSensor);

    public List<AppSensor> selectAppSensorAll(AppSensor appSensor);

    /**
     * 新增传感器管理
     *
     * @param appSensor 传感器管理
     * @return 结果
     */
    public int insertAppSensor(AppSensor appSensor);

    /**
     * 修改传感器管理
     *
     * @param appSensor 传感器管理
     * @return 结果
     */
    public int updateAppSensor(AppSensor appSensor);

    /**
     * 修改传感器状态
     *
     * @param appSensor 传感器管理状态
     * @return 结果
     */
    public int updateAppSensorStatus(AppSensor appSensor);

    /**
     * 批量删除传感器管理
     *
     * @param sensorIds 需要删除的传感器管理主键集合
     * @return 结果
     */
    public int deleteAppSensorBySensorIds(Long[] sensorIds);

    /**
     * 删除传感器管理信息
     *
     * @param sensorId 传感器管理主键
     * @return 结果
     */
    public int deleteAppSensorBySensorId(Long sensorId);

    public String checkAppSensorNameUnique(String sensorName);

    /**
     * 根据传感器ID查询设备树信息
     *
     * @param sensorId 传感器ID
     * @return 选中传感器列表
     */
    public List<Long> selectAppSensorDeptListBySensorId(Long sensorId);

    public List<Long> selectAppSensorPlaceListBySensorId(Long sensorId);

    public int authDeptScope(AppSensor sensor);

    public int authPlaceScope(AppSensor sensor);

    List<AppSensor> selectAppSensorListByGatewayType(String type);

    void updateByModbus(AppSensor sensor);

    void updateByModbusList(List<AppSensor> sensorList);

    List<AppSensor> selectAppSensorNameAll(AppSensor appSensor);

    List<AppSensor> selectAppSensorAllList(AppSensor appSensor);

    List<AppSensor> selectAppSensorAllListByDeviceId(Long deviceId);
    List<AppSensor> selectAppSensorAllListByDeviceIdForApp(Long deviceId);

    TableDataInfo selectValueFromRedis(TableDataInfo tableDataInfo);

    void quartzRecordValue();
    void quartzSaveRecordValue();

    public int updateAppSensorFault(AppSensor sensor);

    List<AppSensor> selectAppSensorAllListByDeviceIds(List<Long> deviceIds);

    List<AppSensorPlace> selectAppSensorPlaceIdListBySensorIds(List<Long> sensorIdList);

    List<AppSensorDept> selectAppSensorDeptIdListBySensorIds(List<Long> sensorIdList);

    List<AppSensor> selectAppSensorAllListByDeviceIdsForAPP(List<Long> deviceIds);

    void deleteAppSensorByDeviceId(Long deviceId);

    List<AppSensor> selectAppSensorAllPureList(AppSensor appSensor);
}
